package A.q.day06;
import java.util.Scanner;
public class Addition {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int score=0;
        for(int o=1;o<=5;o++) {
            int q = (int) (Math.random() * 1000 + 9);
            int w = (int) (Math.random() * 1000 + 9);
            int e = q + w;
            System.out.println("(" + o + ")" + q + "+" + w + "=?");
            System.out.println("开始");
            int r = scanner.nextInt();
            if (r == e) {
                System.out.println("答对");
                score += 5;
            } else {
                System.out.println("答错");
            }
        }
        System.out.println("总分："+score);



















        /*Scanner scan=new Scanner(System.in);
        int score=0;
        for (int i = 1; i <10 ; i++) {
            int a=(int)(Math.random()*100);
            int b=(int)(Math.random()*100);
            int result=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧!");
            int answer=scan.nextInt();
            if(answer==result){
                System.out.println("答对了");
                score+=10;
            }else{
                System.out.println("答错了");
            }
        }
        System.out.println("总分为："+score);
    */
    }
}
